/**
 * @author zhangshuai
 * @version V1.0
 * @Project Java2_26
 * @Package PACKAGE_NAME
 * @Description:
 * @Date 2025/5/13 14:28
 */

public class Demo4 {

    //封装：一般为了限定属性，方法的使用权限      封装类：为了将我们需要的一部分资源提取出来使用
    //限定修饰符：public proceted default private

    private String name;

    protected int age;
    String pwd;
    public char gender;

    public void study(){
        System.out.println(name + "已经学习了" + age + "小时");
    }

     void study1(){
        System.out.println(name + "已经学习了" + age + "小时");
    }

    protected void eatEggsAndRise(){
        System.out.println(name + "已经吃了" + age + "小时");
    }

    private void eatEggsAndRise1(){
        System.out.println(name + "已经吃了" + age + "小时");
    }

    public static void main(String[] args) {
        Demo4 demo4 = new Demo4();
        demo4.name = "张三";
        demo4.age = 18;
    }

}